<!DOCTYPE html>
<html>
<head>
    <title>支付管理</title>
    <include file='public/head'>
	<style>
		.layui-legend-size{font-size:14px !important;}
		.layui-nopadding{padding:0 !important;}
		.layui-overflow{overflow:auto;}
		.layui-nomargin{margin: 0 !important;}
		.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}
		.layui-input{height:30px !important; }
		.layui-form-search-item .layui-inline{margin-bottom: 5px;} 
		.layui-form-search-item label{margin-left: 15px;}
		.layui-table-page {padding: 7px 0px 0px;}
		.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}
	</style>
</head>
<body>
	<!-- layui-tab开始 -->
	<div class="layui-tab " lay-filter="demo-tab" >
		<!-- 顶部导航菜单开始 -->
		<div class="layui-tab-nav" >
			<ul class="layui-tab-title">
				{:};
				<?php 
				    getNav('pay','admin_index/index');
				?>
				
			</ul>
		</div>	
		<!-- 顶部导航菜单结束 -->

		<!-- 开始 -->
		<fieldset class="layui-elem-field layui-field-title layui-field-padding" >
			<legend class="layui-legend-size">支付方式启用/关闭功能配置</legend>
			
			<form class="layui-form"  action="" >
                <div class="layui-form-item">
                    <div class="layui-input-block pay-list-item" style="margin-left:10px!important;margin-top:10px;">
                        <volist name="payList" id="vo">
                            <input type="checkbox" lay-filter="payway" name="{$vo.value}" title="{$vo.title}"  {$vo.checked}>
                        </volist>
                        <empty name="payList">
                            未安装插件
                        </empty>
                    </div>
                </div>
                <button style="display:none;" lay-submit lay-filter="paywayf" id="tj">提交</button>     
            </form>
		</fieldset>
		<!-- 结束 -->
		<blockquote class="layui-elem-quote">温馨提示:以下参数配置,请不要轻易修改.</blockquote>
		<!-- 开始 -->
		<fieldset class="layui-elem-field layui-field-title layui-field-padding" >
			<legend class="layui-legend-size">支付参数配置</legend>
			
            <div class="layui-tab" style="padding-top:10px;">
                <ul class="layui-tab-title">
                	<?php $k = 0 ; ?>
                    <volist name="payListConfig" id="vo" >
                        <li <?php  if( $k == 0 ) echo 'class="layui-this"'; $k++; ?> ><a>{$vo['title']}</a></li>
                    </volist>
				</ul>
				<?php $k = 0 ; ?>
                <div class="layui-tab-content">
                    <volist name="payListConfig" id="vo" >
                        <div  class="layui-tab-item <?php if($k==0) echo 'layui-show'; $k++; ?>">
                            {$vo['html']}
                        </div>
                    </volist>
                </div>

                <empty name="payListConfig">
                    未安装插件
                </empty>
            </div>
		</fieldset>
		<!-- 结束 -->
		
	</div>
	<!-- layui-tab结束-->
	<include file='public/scripts'>
    
	<script>
	    ;(function(){
	        var form = layui.form;
	        $('.pay-list-item .layui-form-checkbox').each(function(){
	            $(this).on( 'mouseover' ,function(){
	                let text = $(this).hasClass( 'layui-form-checked' ) ? '功能已开启' : '功能已关闭';
	                layer.tips( text  , this , { 
	                    tips:[1,'#18BC9C']
	                });
	            });
	            $(this).on( 'click' ,function(){
	                let text = $(this).hasClass( 'layui-form-checked' ) ? '功能已开启' : '功能已关闭';
	                layer.tips( text  , this , { 
	                    tips:[1,'#18BC9C']
	                });
	            });
	        });
	        
	        form.on('checkbox(payway)', function(data){
              $('#tj').click();
            });
            form.on('submit(paywayf)' , function(data){
                $.post('{:cmf_plugin_url("Pay://admin_index/savePayList")}' , {list:data.field} , function( res ){
                   // layer.msg( res.message );
                });
                return false;
            })
	    })();
	</script>
	



</body>
</html>